.BG
.FN Arithmetic
.FN +
.FN -
.FN *
.FN /
.FN ^
.FN %/%
.FN %%
.TL
Arithmetic Operators
.CS
e1 op e2
.AG e1,e2
numeric or complex.  Missing values (`NA's) are allowed.
.AG op
one of `+', `-', `*', `/', `^', `%/%' or `%%'.
.RT
numeric or complex result, with the shorter argument used
cyclically, if necessary: `+', `-', `*' and `/'
are the usual arithmetic operators and `^' is
exponentiation. (`**' is a deprecated synonym for `^').
.PP
`%/%' is integer divide; the operands should
be numeric and the result is `floor(e1/e2)' if `e2!=0'
and `0' otherwise.
.PP
`%%' is the modulo function; it also expects numeric operands and is
defined as `e1\-floor(e1/e2)*e2' if `e2!=0'
and `e1' otherwise (see Knuth).
Thus `%/%' and `%%' always satisfy `e1==(e1%/%e2)*e2+e1%%e2'.
.PP
For `^' with numeric arguments, and negative elements in both `e1' and `e2':
the values returned will be those of `1/(e1^(-e2))' if the element of `e2'
is judged to be exactly or nearly an integer, and `NA' otherwise.  The
integer test is machine-dependent and should not be counted on in doubtful
cases.
.PP
Section 5.6.1 describes the rules for dealing with operands with attributes.
Also see section 5.1.5 for details on domains and branch cuts in the
case of complex arguments for exponentiation.
.SH REFERENCE
D. E. Knuth,
.ul
The Art of Computer Programming, Fundamental Algorithms
Vol. 1, Section 1.2.4.,
Addison-Wesley, 1968.
.EX
x-mean(x)	# deviations from the mean; second argument used repeatedly
(1+(5:8)/1200)^12     # compound interest, 5:8 per annum monthly
.KW math
.KW complex
.WR
